<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <include file="Public:resource"/>
    <title>用水查询</title>
</head>
<body>
<div class="container">
    <include file="Public:topWithoutBack" title="用水查询"/>
    <empty name="relevanceModel"><!--未绑定账号-->
        <div class="row" style="margin-top: 50px;">
            <div class="col-xs-12 col-sm-12 col-mg-12 col-md-12" style="font-size: medium;" align="center">
                您尚未绑定任何水费账号
            </div>
        </div>
        <div class="row" style="margin-top: 10px;">
            <div class="col-xs-12 col-sm-12 col-mg-12 col-md-12">
                <input type="button" class="btn btn-lg btn-block jss-button"
                       onclick="onBind() " value="立即绑定"/>
            </div>
        </div>
        <else/>
        <form action="{:U('Service/usedSearchResult')}" method="post" id="SearchForm">
            <div class="row" align="left" style="margin-top: 20px;">
                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 align-to-input medium">
                    水费账号
                </div>
                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                    <select name="userid" id="userid" class="select">
                        <foreach name="relevanceModel" item="relevance">
                            <option value="{$relevance.userid}">{$relevance.userid}</option>
                        </foreach>
                    </select>
                </div>
            </div>
            <div class="row" align="left" style="margin-top: 10px;">
                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 align-to-input medium">
                    查询年度
                </div>
                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                    <select name="year" id="year" class="select">
                        <option value="2015">2015年</option>
                        <option value="2014">2014年</option>
                        <option value="2013">2013年</option>
                    </select>
                </div>
            </div>
        </form>

        <div class="row" style="margin-top: 20px;">
            <div class="col-xs-12 col-sm-12 col-mg-12 col-md-12">
                <div><input type="button" class="btn btn-lg btn-block jss-button"
                            onclick="onSearch() " value="查询"/>
                </div>
            </div>
        </div>
    </empty>

    <include file="Public:menu"/>
</div>
<script>
    //搜索
    function onSearch() {
        if ($("#userid").val() == '') {
            alert("请填写水费账号");
            return;
        }
        if ($("#year").val() == '') {
            alert("请选择年份");
            return;
        }
        $("#SearchForm").submit();
    }
    //去绑定
    function onBind() {
        window.location.href = "{:U('Bind/add')}";
    }
</script>
</body>
</html>